#ifndef DESKTOPNOTE_H
#define DESKTOPNOTE_H

#include <QWidget>
#include <QMessageBox>
#include <QMouseEvent>
#include <QPainter>
#include <QMenu>
#include <QAction>
#include <QSystemTrayIcon>
//#include "xlsxabstractooxmlfile.h"
//#include "xlsxabstractsheet.h"
//#include "xlsxabstractsheet.h"
#include "noteitem.h"

namespace Ui {
class DesktopNote;
}

class DesktopNote : public QWidget
{
    Q_OBJECT

public:
    explicit DesktopNote(QWidget *parent = 0);
    ~DesktopNote();
private:
    //运行读取便签信息
    void RunGetBianQianMessage();
    //将读取出的信息创建为Item添加到ListWidget
    void RunGetBianQianMessageSetItem(QString Month,QString Day, QString Week, QString MettingTime, QString MettingAddr, QString Message);

    void QXlsxDataReplace(void);
    // 鼠标按下事件
    void mousePressEvent(QMouseEvent *event);
    // 鼠标移动事件
    void mouseMoveEvent(QMouseEvent *event);
    // 鼠标释放事件
    void mouseReleaseEvent(QMouseEvent *event);
    void createActions();
    void createMenu();
private slots:
    void ListWidgetItemDelSlot(QListWidgetItem *m_pItem);
    void on_NoteAddPushButton_clicked();
    void AlarmSettingEnterSlot(int,int,int,QString,QString,QString);
    void AlarmSettingPushSlot(QListWidgetItem *pItem);
    void MouseRightButtonCloseSlot();
    void MouseRightButtonHideSlot();

private:
    Ui::DesktopNote *ui;    
    QSystemTrayIcon* mSysTrayIcon;
    QMenu *MouseRightButtonMenu;

    int CurrDelItemIndex;//当前被删除的Item索引
    int ItemCount;//ListWidget总的Item条数
    int CurrItemIndex;//添加Item时，对应的索引号

    int Month;
    int Day;
    int Week;//周几

    QString MettingTime; //会议时间
    QString MettingAddr; //会议地点
    QString EventContent;//事件内容

    bool m_bDrag1;
    QPoint mouseStartPoint;
    QPoint windowTopLeftPoint;
    QAction *mShowMainAction;
    QAction *mExitAppAction;
    QAction *mHideAppAction;
};

#endif // DESKTOPNOTE_H
